<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <%
        pageContext.setAttribute("APP_PATH", request.getContextPath());
    %>
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <title>教师</title>
</head>
<jsp:include page="teacher_header.jsp"/>

<div class="container">
    <div class="row">
        <div class="col-md-12">
            <h1>已提交审核专利</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 col-md-offset-8">
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover" id="submited_patent_table">
                <thead>
                <tr>
                    <th>专利名称</th>
                    <th>专利类型</th>
                    <th>专利所有人</th>
                    <th>第一发明人</th>
                    <th>发明人</th>
                    <th>发表时间</th>
                    <th>状态</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $.ajax({
            url: "${APP_PATH}" + "/show_patent",
            data: {"Id": window.sessionStorage["userId"], "ope": 0, "pn": 1},
            type: "GET",
            success: function (result) {
                console.log(result);
                //1、解析并显示数据
                build_sub_patent(result);
            }
        });
    });

    function build_sub_patent(result) {
        //清空table表格
        $("#submited_patent_table tbody").empty();
        var emps = result.data.list;
        $.each(emps, function (index, item) {
            var name = $("<td></td>").append(item.patentname);
            var type = $("<td></td>").append(item.patenttype);
            var own = $("<td></td>").append(item.itemown);
            var first = $("<td></td>").append(item.firstname);
            var all = $("<td></td>").append(item.allname);
            var time = $("<td></td>").append(item.endtime);
            $("<tr></tr>").append(name).append(type)
                .append(own).append(first).append(all).append(time).append("等待审核")
                .appendTo("#submited_patent_table tbody");
        });
    }
</script>

</body>
</html>
